﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Argument
{
    [TestClass]
    public class HasAttributeTest
    {
        [Arcana.Contract.Argument.Has("param", 6)]
        public static void Target_1(IList<int> param)
        {
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentException))]
        public void ShouldThrowException()
        {
            Target_1((new int[] { 1, 4, 8, -1 }).ToList());
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [Description("Added due to a bug, caused by using existential quantification")]
        [ExpectedException(typeof(ArgumentException))]
        public void ShouldThrowException_2()
        {
            Target_1(new int[] { }.ToList());
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        public void ShouldPass()
        {
            Target_1(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }.ToList());
        }
    }
}
